﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplicationGDI1._1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            // События формы, событие клик. создаем его
        }

        private void Form1_Click(object sender, EventArgs e)
        {
            textBox1.Text = ((e as MouseEventArgs).X + " " + (e as MouseEventArgs).Y);

            Bitmap bm1 = Bitmap.FromFile("C:\\Desert.bmp") as Bitmap;

            bm1 = Filters.CopyAsGrayscale(bm1);
            BackgroundImage = bm1;
            bm1.RotateFlip(RotateFlipType.RotateNoneFlipNone);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Bitmap bm = new Bitmap(ClientSize.Width, ClientSize.Height);

            Graphics gp = Graphics.FromImage(bm);

            Pen p = new Pen(Color.DarkBlue);
            p.Width = 3;
            // <body>

            Point[] pArr = new Point[24];

            pArr[0] = new Point(190, 229);
            pArr[1] = new Point(272, 239);
            pArr[2] = new Point(313, 212);
            pArr[3] = new Point(320, 185);
            pArr[4] = new Point(326, 175);
            pArr[5] = new Point(335, 173);
            pArr[6] = new Point(343, 178);
            pArr[7] = new Point(356, 164);
            pArr[8] = new Point(405, 114);
            pArr[9] = new Point(408, 96);
            pArr[10] = new Point(413, 85);
            pArr[11] = new Point(424, 80);
            pArr[12] = new Point(437, 82);
            pArr[13] = new Point(446, 80);
            pArr[14] = new Point(466, 61);
            pArr[15] = new Point(471, 44);
            pArr[16] = new Point(460, 32);
            pArr[17] = new Point(419, 20);
            pArr[18] = new Point(358, 17);
            pArr[19] = new Point(289, 63);
            pArr[20] = new Point(215, 148);
            pArr[21] = new Point(183, 208);
            pArr[22] = new Point(186, 222);
            pArr[23] = new Point(196, 228);

            gp.DrawCurve(p, pArr);

            p.Color = Color.DarkGreen;
            gp.DrawEllipse(p, new Rectangle(320, 183, 30, 30));
            gp.DrawEllipse(p, new Rectangle(414, 85, 30, 30));

            SolidBrush sb = new SolidBrush(Color.HotPink);
            gp.FillEllipse(sb, new Rectangle(414, 85, 30, 30));
            sb.Color = Color.RoyalBlue;
            gp.FillEllipse(sb, new Rectangle(320, 183, 30, 30));

            gp.FillClosedCurve(sb, pArr);

            // </body>

            gp.Dispose();

            BackgroundImage = bm;
        }
    }
}
